﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using S4Store.Domain.FinancialKpi;
using LX.Web.Excel;

namespace S4Store.Domain.FinancialReport
{
    public class CarBrandFinancialReport:FinancialCommonReport
    {

        [Export("合计标题")]
        public virtual string HjTitle
        {
            get { return CarBrand.Name; }
        }

        public CarBrand CarBrand { get; set; }
        public FinancialCommonReport StoreReport { get; set; }

        public CarBrandFinancialReport()
        {
            FinancialDayDatas = new List<FinancialDayData>();
        }


        public FinancialCarBrandMonthConfig FinancialCarBrandMonthConfig { get; set; }

        /// <summary>
        /// 月初库存成本
        /// </summary>
        [Export("月初库存成本")]
        public override decimal YCKCCB
        {
            get
            {
                return FinancialCarBrandMonthConfig.YCKCCB ;
            }
        }

        /// <summary>
        /// 月末库存成本
        /// </summary>
        [Export("月末库存成本")]
        public override decimal YMKCCB
        {
            get
            {
                return FinancialCarBrandMonthConfig.YMKCCB;
            }
        }

        /// <summary>
        /// 库存平均成本
        /// </summary>
        [Export("月库存平均成本")]
        public override decimal KCPJCB
        {
            get
            {
                return (FinancialCarBrandMonthConfig.YCKCCB + FinancialCarBrandMonthConfig.YMKCCB) / 2;
            }
        }

        /// <summary>
        /// 车辆销售成本
        /// </summary>
        [Export("本月车辆销售成本")]
        public override decimal CLXSCB
        {
            get
            {
                return FinancialCarBrandMonthConfig.CLXSCB;
            }
        }


        ///// <summary>
        ///// 售后总产值
        ///// </summary>
        //public override decimal SHZCZ
        //{
        //    get
        //    {
        //        return FinancialCarBrandMonthConfig.SHZCZ;
        //    }
        //}

        /// <summary>
        /// 服务吸收率贡献度
        /// </summary>
        [Export("服务吸收率贡献度",Format="{0}%")]
        public override decimal FWXSLGXD
        {
            get
            {
                if (StoreReport.XSE == 0) return 0;
                return this.XSE * 100 / StoreReport.XSE;
            }
        }

        /// <summary>
        /// 服务吸收率目标
        /// </summary>
        [Export("服务吸收率目标", Format = "{0}%")]
        public override decimal FWXSLVTarget
        {
            get
            {

                return FWXSLGXD * this.FinancialMonthConfig.GSFWXSLVMB/100;
            }
        }

        /// <summary>
        /// 目标周转天数
        /// </summary>
        [Export("目标周转天数1", MergeVertical=true)]
        public override decimal MBZZTS
        {
            get
            {
                return base.MBZZTS;
            }
        }
        /// <summary>
        /// 本月4S店运营成本
        /// </summary>
        [Export("本月4S店运营成本1", MergeVertical = true)]
        public override decimal YYCB
        {
            get
            {
                return base.YYCB;
            }
        }

       
    }
}
